The recent change in #1939 ended up accidentally pulling in irrelevant
platform-specific dependencies into a normal `cargo doc`, causing those builds
to fail. This change tweaks the logic for calculating documentation dependencies
to account for filtering based on the relevant platform.